import { createRouter, createWebHistory } from 'vue-router'

import Home from '@/views/home.vue'
import Index from '@/views/index.vue'
import Register from '@/views/register.vue'
import Login from '@/views/login.vue'
import Cla from '@/views/cla.vue'
import Search from '@/views/search.vue'
import Detail from '@/views/detail.vue'
import Dd from '@/views/dd.vue'
import Cart from '@/views/cart.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/home',
      name: 'home',
      component: Home,
      children: [
        {
          path: 'index',
          name: 'index',
          component: Index,
        },

      ]
    },
    {
      path: '/register',
      name: 'register',
      component: Register,
    },
    {
      path: '/login',
      name: 'login',
      component: Login,
    },
    {
      path: '/cla/',
      name: 'cla',
      component: Cla,
    },
    {
      path: '/search/:query',
      name: 'search',
      component: Search,
    },
  
    {
      path:'/detail/',
      name:'detail',
      component:Detail

    },
    {
      path: '/dd',
      name: 'dd',
      component: Dd,
      
    },
    {
      path: '/cart',
      name: 'cart',
      component: Cart,
      
    },
    

  ],
})

export default router
